<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>按需加载模块</button>
    <script type="module">
        document.querySelector('button').addEventListener('click', () => {
            // import()方法按需加载模块 返回promise对象
            import('./com.js').then(({ m01, m02, m03 }) => {
                console.log(m01)
                console.log(m02)
                console.log(m03)
            })
        })

        // 多层解构
        let a = {
            b: 1,
            c: {
                d: 2,
                e: {
                    f: 6
                }
            }
        }
        let { b, c,c: { d, e,e: { f } } } = a;
        console.log(a)
        console.log(b)
        console.log(c)
        console.log(d)
        console.log(e)
        console.log(f)
    </script>
</body>

</html>